<!DOCTYPE html>
<html>
  
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Travian辅助</title>
    <meta name="keywords" content="淮阳网站建设|周口网站建设">
    <meta name="description" content="淮阳网站建设|周口网站建设">
    <meta content="telephone=no" name="format-detection">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <!--双引擎浏览器默认webkit打开-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <meta name="full-screen" content="yes">
    <link rel="stylesheet" href="/static/uikit/css/uikit.css">
	<script type="text/javascript" src="/static/jquery/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="/static/uikit/js/uikit.js"></script>
    <style>
	
	</style>
	</head>
  
  <body>
  <form class="uk-form uk-width-medium-1-3" action="{:url('lucn/toutiao/index')}" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1">

                                <fieldset>
                                    <legend>Legend</legend>
                                    <div class="uk-form-row">
                                        <input type="text" name="url" placeholder="url" value="{$url|default=''}">
                                    </div>
                                    <div class="uk-form-row" id="submit">
                                        <button class="uk-button" type="submit">格式化图文</button>
                                    </div>
                                </fieldset>

                            </form>
  <div class="out">
  <textarea id="editor_id" name="content" style="width:960px;height:640px;">
{$html|default=''}</textarea>
  </div>
  </body>

<script>
$(document).ready(function(){
/*
$('[name="form1"]').on("click", "#submit",function(){

var url = $('[name="url"]').val();
	var data = {};
	data['url'] = url;
	$.ajax({
		url: "{:url('/lucn/toutiao/format')}",
		data: data,
		dataType: 'json',
		type: 'post',
		cache:false,
		success: function(res) {
			$('.out').html(res);
		}
		
	});

/*
    var url = $('[name="url"]').val();
    $.get(url,
        function(res) {
	        var n11 = res.indexOf('gallery: JSON.parse(');
            n11 += 20;
			var n12 = res.indexOf('siblingList:');
			n12 += -7;
			var json = res.substring(n11, n12);
			//解析json
			var img,html;
			html = '';
			console.log(json);
			
			var jsondata = $.parseJSON(json);
			//console.log(jsondata);
			
			for(k=0;k<jsondata.count;k++){
			    console.info(jsondata.sub_abstracts[k]);
				img = jsondata.sub_images[k];
				img.url
				html += '<p>'+jsondata.sub_abstracts[k]+'</p>';
				html += '<p><img src="'+img.url+'"></p>';
			}
			
			
			//console.info(jsondata);
			
            $('.out').html(html);
    });
	*/
	
	/*
    $.get("{:url('/lucn/toutiao/format')}",
        function(res) {
	        var n11 = res.indexOf('gallery: JSON.parse(');
            n11 += 20;
			var n12 = res.indexOf('siblingList:');
			n12 += -7;
			var json = res.substring(n11, n12);
			//解析json
			var img,html;
			html = '';
			console.log(json);
			
			var jsondata = $.parseJSON(json);
			//console.log(jsondata);
			
			for(k=0;k<jsondata.count;k++){
			    console.info(jsondata.sub_abstracts[k]);
				img = jsondata.sub_images[k];
				img.url
				html += '<p>'+jsondata.sub_abstracts[k]+'</p>';
				html += '<p><img src="'+img.url+'"></p>';
			}
			
			//console.info(jsondata);
			
            $('.out').html(html);
    });
	*/
	/*
});
*/

});
</script>
<script charset="utf-8" src="http://127.0.0.1/test1/static/kindeditor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="http://127.0.0.1/test1/static/kindeditor/lang/zh-CN.js"></script>
<script>
        KindEditor.ready(function(K) {
                window.editor = K.create('#editor_id');
        });
</script>
</html>